#define	r3	3
#define	r4	4
#define	r5	5
#define	r6	6
#define	r7	7
#define	r8	8
#define	r9	9

   .globl memset_stswi
   .align 2
   # r3 = number of the benchmark loops
   # r4 = buffer pointer
   # r5 = number of words in the buffer
   # r6 = value to set (int)
memset_stswi:
   mtctr r3
   mtusprg0 r4
   #srawi r3, r5, 2 # Divide by 4 because 4 registers will be used
   mr    r7, r6
   mr    r8, r6
   mr    r9, r6
1:
   li    r3, 0
   mfusprg0 r4
2:
   stswi r6, r4, 0 # Transfer 16 bytes (that is to say 4 GPRs)
   addi  r3, r3, 4
   addi  r4, r4, 16
   cmpw  0, r3, r5
   blt   2b
   bdnz  1b
   blr

